Skip to content

fix(profile): preserve unmodeled metadata on update#2545

Draft
Cvv9 wants to merge 1 commit into
block:mainfrom
Cvv9:codex/preserve-profile-fields
Draft

fix(profile): preserve unmodeled metadata on update#2545
Cvv9 wants to merge 1 commit into
block:mainfrom
Cvv9:codex/preserve-profile-fields

Conversation

@Cvv9

@Cvv9 Cvv9 commented Jul 23, 2026

Copy link
Copy Markdown

Fixes #2534.

What changed

  • Added an SDK profile builder that overlays Buzz-owned fields onto the complete existing kind:0 object.
  • Updated buzz users set-profile to preserve name and every unmodeled field instead of rebuilding from a five-key allowlist.
  • Updated Desktop profile edits to merge into the raw current profile object.
  • Updated automatic managed-agent profile sync to read the existing kind:0 before publishing a rename/avatar change.
  • Added regression coverage for bot, website, lud16, nip05, and other passthrough metadata.

Root cause

Kind 0 is a replaceable event, but Buzz's builders created a new JSON object containing only display_name, name, picture, about, and nip05. Every omitted key was therefore deleted on the relay. The managed-agent path was especially destructive because it automatically published only display_name and picture.

The CLI also promoted a stored name into display_name when no display name existed, while deleting the original name key.

User impact

Profile edits and automatic agent reconciliation now preserve metadata created by other Nostr clients and future NIPs. In particular, Buzz no longer silently removes the NIP-24 bot: true disclosure, NIP-05 identity, website, banner, Lightning address, or unknown extension fields.

If the existing profile cannot be queried, managed-agent synchronization fails safely instead of publishing a destructive partial replacement.

Validation

  • cargo fmt --all
  • cargo fmt --manifest-path desktop/src-tauri/Cargo.toml
  • 5 Buzz SDK profile tests passed
  • cargo check -p buzz-cli
  • 21 Desktop profile-related tests passed

Signed-off-by: Cvv9 <Varun.cumbamangalam@oralens.com>
@Cvv9
Cvv9 force-pushed the codex/preserve-profile-fields branch from c33eb66 to 8b3cb04 Compare July 23, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kind:0 profile republish drops every field outside a 5-key allowlist — silently deletes bot: true, nip05 and website

1 participant